package cn.powertime.evaluation.vo;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.*;
import java.io.Serializable;

@Data
public class ReqUserUpdateVo implements Serializable {

    @ApiModelProperty(value = "用户ID", position = 1)
    @NotNull(message = "系统用户ID不能为空")
    private Long id;

    @ApiModelProperty(value = "头像ID", position = 2)
    private Long avatar;

    @ApiModelProperty(value = "昵称", position = 3)
    @Pattern(regexp = "([\\u4e00-\\u9fa5]{2,10})|([A-Za-z0-9]{4,12})", message = "昵称必须由4-12个字母和数字或2-10个汉字组成")
    private String nickname;

    @ApiModelProperty(value = "姓名", position = 4)
    @Pattern(regexp = "[\\u4e00-\\u9fa5]{2,6}", message = "姓名不能为空，必须由2-6个汉字组成")
    private String username;

    @ApiModelProperty(value = "性别，1:男，0:女", position = 5)
    @NotNull(message = "性别不能为空")
    @Max(value = 1, message = "性别最大值为1")
    @Min(value = 0, message = "性别最小值为0")
    private Integer sex;

    @ApiModelProperty(value = "个人介绍", position = 6)
    @NotBlank(message = "个人介绍不能为空")
    @Length(max = 500, message = "个人介绍长度不能超过500个字符")
    private String introduction;

    @ApiModelProperty(value = "邮箱", position = 7)
    @Pattern(regexp = "^[a-zA-Z0-9_.-]+@[a-zA-Z0-9-]+(\\.[a-zA-Z0-9-]+)*\\.[a-zA-Z0-9]{2,6}$",message = "邮箱格式不正确")
    private String email;

}
